import constant from '@/utils/constant'
import request from '@/utils/request'

/**
 * 获取验证码
 */
export function getCode(data) {
	uni.showLoading();
	
	return request({
		url: constant.getCode,
		method: 'POST',
		data
	})
}

/**
 * 获取小区信息
 */

export function getCommunity(data) {
	console.log(data)
	return request({
		url: constant.getCommunity,
		method: 'GET',
		data
	})
}

/**
 * 按照地区获取小区
 */
export function getCommunitys(data) {
	return request({
		url: constant.listCommunitys,
		method: 'GET',
		data
	})
}

/**
 * 获取楼栋
 */
export function getQueryFloors(data) {
	uni.showLoading({
		title: '加载中'
	})
	return request({
		url: constant.getQueryFloors,
		method: 'GET',
		data
	})
}

/**
 * 获取单元
 */
export function getQueryUnits(data) {
	uni.showLoading({
		title: '加载中'
	})
	return request({
		url: constant.getQueryUnits,
		method: 'GET',
		data
	})
}

/**
 * 获取房屋
 */
export function getQueryRoom(data) {
	uni.showLoading({
		title: '加载中'
	})
	return request({
		url: constant.getRoomInfomartion,
		method: 'GET',
		data
	})
}

/**
 * 获取通讯录
 */
export function getStaffInfos(data) {
	uni.showLoading({
		title: '加载中'
	})
	return request({
		url: constant.getStaffInfos,
		method: 'GET',
		data
	})
}